﻿using System;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using System.Xml.Serialization;
using Microsoft.Xna.Framework.Content.Pipeline;

namespace XNADota.ContentPipeline.Terrain
{
    [Serializable()]
    [ContentSerializerRuntimeType("XNADota.Terrain.TexturePalette, XNADota")]
    public class TexturePaletteContent
    {
        public TexturePaletteContent(string textureFileName, ContentProcessorContext context)
        {
            _TextureFileName = textureFileName;
            this.Texture = context.BuildAsset<TextureContent, TextureContent>(
                        new ExternalReference<TextureContent>(textureFileName), "TextureProcessor");
        }

        private string _TextureFileName;
        private ExternalReference<TextureContent> _Texture;

        public ExternalReference<TextureContent> Texture
        {
            set { _Texture = value; }
            get { return _Texture; }
        }

        [ContentSerializerIgnore]
        public string TextureFileName
        {
            set { _TextureFileName = value; }
            get { return _TextureFileName; }
        }
    }
}
